/**
 * Created by User on 2017/2/21.
 */
var JSHash = {
    index: [
        {url:"/static/js/DateUtil.js", version: "1.0"}
    ],
    edit:  [{url:"/static/easyui/js/jquery.easyui.min.js", version: "1.0"}]
};
var status_ = 0;
function loadJS(sKey) {
    var head = document.getElementsByTagName("head")[0];
    var node = JSHash[sKey];
    for(var i =0;i < node.length; i ++) {
        var script = document.createElement('script');
        script.type = 'text/javascript';
        script.src = node[i].url + '?version='+node[i].version;
        console.info(script.src);
        script.onload = function () {
            if (status_ == 0){
                loadJS('edit');
            }
            status_ = 1;
        };
        // document.writeln('<script src="'+node[i].url+'?version='+node[i].version+'"><\/script>');
        head.appendChild(script);
    }
}
